package com.xxtx.trade.web.userCenter;

import com.xxtx.trade.common.util.model.Result;
import com.xxtx.trade.sysUser.dto.TradeSysUserDto;
import com.xxtx.trade.sysUser.service.TradeSysUserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/xxtx/agent")
public class SysAgentController {
    private static final Logger LOGGER = LoggerFactory.getLogger(SysAgentController.class);
    @Autowired
    private TradeSysUserService tradeSysUserService;

    /**
     * 查看所有的代理商
     */
    @RequestMapping(value = "/all/list",method = RequestMethod.POST)
    public Result allList(@RequestBody TradeSysUserDto dto){
        return tradeSysUserService.selectAllAgent(dto);
    }

    /**
     * 查看所有的代理商，wzyk标记：超级管理员使用获取客户列表
     */
    @RequestMapping(value = "/next/agent/list",method = RequestMethod.POST)
    public Result nextList(@RequestBody TradeSysUserDto dto){
        return tradeSysUserService.selectAllAgentByAgentId(dto);
    }

    /**
     * 查看所有的代理商 下拉
     */
    @RequestMapping(value = "/all",method = RequestMethod.POST)
    public Result nextAllAgent(@RequestBody TradeSysUserDto dto){
        return tradeSysUserService.selectAgentAllList(dto);
    }
}
